﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace MVCPets
{
  public class MvcApplication : System.Web.HttpApplication
  {
    public static void RegisterRoutes(RouteCollection routes)
    {
      routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

			routes.MapRoute("PetImageUpload", "Pets/Images",
				new { controller = "Pets", action = "Images" });

			routes.MapRoute("PetImageList", "Pets/UploadImage",
				new { controller = "Pets", action = "UploadImage" });

      routes.MapRoute("Pets", "Pets/{status}",
        new { controller = "Pets", action = "Status" });

      routes.MapRoute("Default", "Pets/Details/{id}/{description}",
        new { controller = "Pets", action = "Details", id = UrlParameter.Optional, description = UrlParameter.Optional });

      routes.MapRoute("PetDetails", "{controller}/{action}/{id}",
        new { controller = "Home", action = "Index", id = UrlParameter.Optional });

    }

    protected void Application_Start()
    {
      AreaRegistration.RegisterAllAreas();

      RegisterRoutes(RouteTable.Routes);
    }
  }
}